<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored ="false"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>北京市电子行政监察平台-系统账号详细</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="<%=path%>/css/base.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/jquery-tree-1.1.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
			var path = "<%=path%>";
		</script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-1.6.1.min.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/jquery-tree-1.1.js"></script>
		<script type="text/javascript">
			var treeData = "<%=request.getAttribute("mergePermissionJsonString")%>";
			var tree;
			$(function () {
				//生成权限树
				tree = new $.Tree({
					parent: $("#authSetup"),
					source: $.parseJSON(treeData),
					allOpen: true,
					pretreatment: function (node) {
						node.content = node.permissionName;
						delete node.permissionName;
						node.children = node.childPermissionDTOs;
						delete node.childPermissionDTOs;
						switch(node.permissionTypeFlag)
						{
						case "0":
							node.content = "<span class='system'>" + node.content + "</span>";
							switch(node.permissionStatus) 
							{
							case "0":
								node.content += "<span class='state system-unspecitied unspecitied type-system'>(未指定)</span>";
								break;
							case "1":
								node.content += "<span class='state system-show show type-system'>(可见)</span>";
								break;
							case "2":
								node.content += "<span class='state system-hide hide type-system'>(不可见)</span>";
								break;
							}
							break;
						case "1":
							node.content = "<span class='auth'>" + node.content + "</span>";
							switch(node.permissionStatus)
							{
							case "0":
								node.content += "<span class='state auth-unspecitied unspecitied type-auth'>(未指定)</span>";
								break;
							case "1":
								node.content += "<span class='state auth-enabled enabled type-auth'>(允许)</span>";
								break;
							case "2":
								node.content += "<span class='state auth-disabled disabled type-auth'>(禁止)</span>";
								break;
							}
							break;
						}
						if(node.children && node.children.length <= 0)
							delete node.children;
						return node;
					}
				});
			});
		</script>
		<style type="text/css">
			div {
				position: static;
			}
		</style>
	</head>
	<body>
		<div class="right pop-window-content">
			<div class="right-all-content">
				<div class="inner-dialog">
					<h1 class="inner-dialog-title">系统账号详细</h1>
					<div class="inner-dialog-content">
					<s:if test="userAccountDTO==null">
					你所查找的账号已被删除，请更新页面
					</s:if>
					<s:else>
						<table class="inner-dialog-content-table new">
							<tbody>
								<tr>
									<td valign="top" style="text-align: right;">
										<span class="detail-feild">创建时间:</span>
									</td>
									<td>
										<s:date name="userAccountDTO.createTime" format="yyyy-MM-dd"/>
									</td>
								</tr>
								<tr>
									<td valign="top" style="text-align: right;">
										<span class="detail-feild">账 号 名:</span>
									</td>
									<td valign="top">
										<s:property value="userAccountDTO.userAccountName"/>
									</td>
								</tr>
								<tr>
									<td valign="top" style="text-align: right;">
										<span class="detail-feild">状　　态:</span>
									</td>
									<td valign="top">
										<s:if test="userAccountDTO.userAccountIsEnabled">
										已启用
										</s:if>
										<s:else>
										已禁用
										</s:else>
									</td>
								</tr>
								<tr>
									<td valign="top" style="text-align: right;">
										<span class="detail-feild">账号使用者:</span>
									</td>
									<td valign="top">
										<s:property value="userAccountDTO.userInfoDTO.userName"/>
									</td>
									
								</tr>
								<tr>
									<td valign="top" style="text-align: right;">
										<span class="detail-feild">账号角色:</span>
									</td>
									<td valign="top">
									 <s:if test="userAccountDTO.roleDTOs!=null">
										<s:iterator value="userAccountDTO.roleDTOs" id="account">
											${account.roleName};
										</s:iterator>
									 </s:if>
									</td>
								</tr>
								<tr>
									<td valign="top" style="text-align: right;">
										<span class="detail-feild">账号权限:</span>
									</td>
									<td valign="top" style="line-height: normal;">
										<div id="authSetup"></div>
									</td>
								</tr>
								<tr>
									<td valign="top" style="text-align: right;">
										<span class="detail-feild">描　　述:</span>
									</td>
									<td valign="top">
										<s:property value="userAccountDTO.userAccountNote"/>
									</td>
								</tr>
							</tbody>
						</table>
					</s:else>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>